package org.rambadger.command.command;
import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;

public class ChangeSystemRole {
    @TargetAggregateIdentifier
    protected final String username;

    protected ChangeSystemRole(String username) {
        this.username = username;
    }

    @UrlIdentifier
    @NotNull
    public String getUsername() {
        return username;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName()+"{" +
                "username='" + username + '\'' +
                '}';
    }

    public static class GrantAdmin extends ChangeSystemRole {
        public GrantAdmin(String username) { super(username); }
    }

    public static class RevokeAdmin extends ChangeSystemRole {
        public RevokeAdmin(String username) { super(username); }
    }

    public static class GrantAccess extends ChangeSystemRole {
        public GrantAccess(String username) { super(username); }
    }

    public static class RevokeAccess extends ChangeSystemRole {
        public RevokeAccess(String username) { super(username); }
    }
}
